clear all;
clc;

load mnist_knn_cos_sup;
load mnist_data;
n = size(nn,1);
d = 100;
for i = 3:6:40
    i
    L = knn2lle(nn(:,1:i),X);
    A = sparse(1:n,1:n,1);
    L = L + A;
    [V,D] = eigs(L,d,'sm');
    VV = V(:,d:-1:1);
    DD = diag(D)-1;
    fname = [int2str(i),'le_cos_sup'];
    save(fname,'VV','DD');
end